package cn.wx.jove.core.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import cn.wx.common.persistence.base.BaseController;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import cn.wx.jove.core.service.UserPlateService;
import cn.wx.jove.core.entity.UserPlate;
import cn.wx.common.persistence.web.ResponseData;
import cn.wx.jove.core.entity.qo.UserPlateQ;
/**
 *   @description : UserPlate 控制器
 *   ---------------------------------
 *   @author  
 *   @since 2018-11-30
 */
@RestController
@RequestMapping("/userPlate")
public class UserPlateController extends BaseController {

    @Autowired
    private UserPlateService userPlateService;

    /**
     * @description : 通过条件获取UserPlate
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-30
     */
    @RequestMapping(value = "/query/unique", method = RequestMethod.POST)
    public ResponseData queryUnique(UserPlateQ userPlateQ) throws Exception {
        return success(userPlateService.queryUnique(userPlateQ,UserPlate.class));
    }

    /**
     * @description : 通过条件获取UserPlate分页
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-30
     */
    @RequestMapping(value = "/query/page", method = RequestMethod.POST)
    public ResponseData queryPage(UserPlateQ userPlateQ) throws Exception {
        return success(userPlateService.queryPage(userPlateQ));
    }

	/**
     * @description : 通过条件获取UserPlate
     * ---------------------------------
     * @author : 
     * @since : Create in 2018-11-30
     */
    @RequestMapping(value = "/query/list", method = RequestMethod.POST)
    public ResponseData queryList(UserPlateQ userPlateQ) throws Exception {
        return success(userPlateService.queryList(userPlateQ));
    }
    
    /**
     * @description : 通过id删除UserPlate
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-30
     */
    @RequestMapping(value = "/remove", method = RequestMethod.POST)
    public ResponseData remove(UserPlate userPlate) throws Exception {
        return success(userPlateService.remove(userPlate));
    }

    /**
     * @description : 通过id更新UserPlate
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-30
     */
    @RequestMapping(value = "/modify", method = RequestMethod.POST)
    public ResponseData modify(UserPlate userPlate) throws Exception {
        return success(userPlateService.modify(userPlate));
    }
    
    /**
     * @description : 新增UserPlate
     * ---------------------------------
     * @author :  
     * @since : Create in 2018-11-30
     */
     @RequestMapping(value = "/create", method = RequestMethod.POST)
     public ResponseData create(UserPlate userPlate) throws Exception {
        return success(userPlateService.create(userPlate));
     }
     
     /**
      * @description : 保存移动位置savePosition
      * ---------------------------------
      * @author :  
      * @since : Create in 2018-11-30
      */
      @RequestMapping(value = "/savePosition", method = RequestMethod.POST)
      public ResponseData savePosition(List<UserPlate> userPlates) throws Exception {
         return success(userPlateService.savePosition(userPlates));
      }
}